function Xrsb = I2C_secondary(S_i,u,DU,VU,t)

Xisp = [S_i(1:3)/DU;S_i(4:6)/VU];
%[] Inertial frame state of spacecraft wrt secondary

d = 1-u;
%[] Distance of secondary body

Xibp = [-d*cos(t);-d*sin(t);0;d*sin(t);-d*cos(t);0];
%[] Inertial frame state of berycenter wrt secondary

Xisb = Xisp-Xibp;
%[] Inertial frame state of spacecraft wrt barycenter

Tir = [cos(t),sin(t),0;...
       -sin(t),cos(t),0;...
       0,0,1];
Tirdot = [-sin(t),cos(t),0;...
       -cos(t),-sin(t),0;...
       0,0,0];
%[] Transformation matrices

Xrsb = [Tir,zeros(3);Tirdot,Tir]*Xisb;
%[] rotating frame state of spacecraft wrt barycenter

% 1 normalize

end